import React from 'react';

interface WellcomeProps {
    name?: string;
    status?: 'loading' | 'error' | 'success';
}

const Wellcome: React.FC<WellcomeProps> = (props) => {
    const {name = 'World', status = 'loading'} = props;
    return <h1>{`Hello, ${name}!`}{status}</h1>;
};

// function Wellcome(props:WellcomeProps) {
//     const {name = 'World', status = 'loading'} = props;
//     return <h1>{`Hello, ${name}!`}{status}</h1>;
// }

const App = () => {
    return (
        <div>
            <Wellcome name={'John'} status={'error'} />
        </div>
    );
};

export default App;